package com.example.administrator.baseadapter.recyclerview.holder;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * Created by baron
 * Date : 2016/5/31 0031 18:29
 * Email: 5267621@qq.com
 */
public class RecyclerViewHolder extends RecyclerView.ViewHolder {

    private ViewHolder mViewHolder;

    public RecyclerViewHolder(Context context, View itemView, ViewGroup parent) {
        super(itemView);
        mViewHolder = new ViewHolder(context, itemView);
    }

    public static RecyclerViewHolder getViewHolder(Context context, View convertView,
                                                   ViewGroup parent, int layoutId, int viewType) {
//        if (convertView == null) {
            View itemView = LayoutInflater.from(context).inflate(layoutId, parent,
                    false);
            RecyclerViewHolder holder = new RecyclerViewHolder(context, itemView, parent);
            return holder;
//        } else {
//            RecyclerViewHolder holder = (RecyclerViewHolder) convertView.getTag();
//            return holder;
//        }
    }

    public IViewHolder getViewHolder() {
        return mViewHolder;
    }
}
